<template>
  <div>
    <p>我的总资产：{{ money }}</p>
    <p>是不是有钱人：<input type="checkbox" :checked='flag'></p>
    
    <p>目前的状态 <span>{{money >=10000 ? '有钱人':'穷光蛋'}}</span></p>
    <p>消费项目</p>
    <button @click='xj()'>洗脚60</button>
    <button @click='cf()'>吃饭100</button>
    <button @click='yh()'>约会1000</button>
    <button @click='swm()'>送外卖+100</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      money: 10000,
      flag: true
    }
  },
  methods: {
    xj(){
      this.money-=60
      this.flag = this.money>10000? true:false 
      
    },
    cf(){
      this.money-=100
      this.flag = this.money>10000? true:false 
    },
    yh(){
      this.money-=1000
      this.flag = this.money>10000? true:false 
    },
    swm(){
      this.money+=100
      this.flag = this.money>10000? true:false 
    }


  },
}
</script>
